package han.Chensing.CibMidi;

import han.Chensing.CibMidi.raw.MidiEvent;

import java.util.List;

public class CibMidiMain {

	public static void main(String[] args) {
		try {
			MidiFile file = new MidiFile("E:\\OLD PHONE R.I.P\\Music\\20770392fa4172cc9f1468a231428c2d.mid");
			file.analyze();
			MidiData data = file.getData();
			List<MidiTrack> tracks = data.getTracks();
			System.out.println("BT:"+data.getMidiBasicInfo().microsecondPerQuarterNote);
			for (MidiTrack track : tracks) {
				int duration = track.getDuration();
				System.out.println(duration);
				/*List<MidiEvent> events = track.getEvents();
				for (MidiEvent event : events) {
					Object[] parameters = event.getParameters();
					System.out.println(
							event.getDeltaTime() + " " +
									event.getTrack() + " " +
									event.getEventType() + " " +
									(parameters == null ? "" : parameters.length));
				}*/
			}
		}catch (Exception e){
			e.printStackTrace();
		}
	}

}
